1. Field of the Invention
The present invention relates to a retaining device for electronic components, and more particularly to a retaining device for mounting a switch to an enclosure.
2. Description of the Related Art
When using a computer, a user may need to know the state of an enclosure of the computer for safety and maintenance reasons. A switch installed in the enclosure can detect whether a cover of the enclosure is in a closed position. Taiwan Patent No. 215298 discloses a retaining device for a switch. The retaining device comprises a rectangular bottom wall, with a plurality of holes being defined in the bottom wall. An elastic obtuse sidewall extends upwardly from one end of the bottom wall, and an L-shaped sidewall extends from another end of the bottom wall. In assembly, the obtuse sidewall is pushed outwardly, and a switch is received between the obtuse and L-shaped sidewalls. The obtuse sidewall is then released, whereupon it rebounds and clamps the switch between the obtuse and L-shaped sidewalls. A plurality of screws is extended into the holes of the bottom wall for fastening the combined switch and retaining device to another piece of equipment such as a computer enclosure. However, the retaining device only restricts movement of the switch along a first axis that is perpendicular to the obtuse and L-shaped sidewalls. The retaining device does not restrict movement of the switch along a second axis that is parallel to the obtuse and L-shaped sidewalls. In addition, attachment of the retaining device using screws is unduly laborious and time consuming. Furthermore, a tool is usually required for installation and removal of the screws.
Accordingly, an object of the present invention is to provide a retaining device which enables a switch to be easily and securely attached to a computer enclosure.
To achieve the above object, a retaining device for a switch in accordance with the present invention comprises a main wall and left and right side walls extending outwardly from opposite sides of the main wall. The main wall and the left and right side walls cooperatively define a space therebetween for accommodating the switch therein. A pair of pins is stamped perpendicularly from the main wall. An extension tab extends from the left side wall and defines a through aperture therein. A bent tab extends from the right side wall. In assembly, the switch is received in the retaining device with the pins being received in through holes of the switch. The combined retaining device and switch is then attached to a panel of the enclosure. The bent tab is inserted into a locking aperture of the panel. A screw is extended through the through aperture to engage with the panel at a screw aperture thereof.
Other objects, advantages and novel features of the present invention will be drawn from the following detailed description of a preferred embodiment of the present invention with the attached drawings, in which: